﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<System.String>" %>
     <%: Html.TextBox("", Model) %>

<script type="text/javascript">
    $(function () {

//        function onAddTag(tag) {
//            alert("Added a tag: " + tag);
//        }
//        function onRemoveTag(tag) {
//            alert("Removed a tag: " + tag);
//        }

        $('#Tags').tagsInput({
            onChange: function (elem, elem_tags) {
                var languages = ["book", "furniture", "tool", "music", "service", "toy", "art", "conversation"];
                $('.tag', elem_tags).each(function () {
                    if ($(this).text().search(new RegExp('\\b(' + languages.join('|') + ')\\b')) >= 0)
                        $(this).css('background-color', 'yellow');
                });

            },

            'width':'231px',
            //'autocomplete_url': '/tags-common.html'
            //'autocomplete': {"1": "book", "2": "furniture","3": "tool","4": "music","5":  "service","6":  "toy","7":  "art","8":  "conversation"}
        });
    });
</script>
        

<%--<script type="text/javascript" src="/Scripts/jquery-ui-1.8.14.custom.min.js"></script>
<link rel="stylesheet" type="text/css" href="/Scripts/jquery-ui/jquery-ui-1.8.14.custom.css" />--%>

<link rel="stylesheet" type="text/css" href="/Scripts/tagit/jquery.tagsinput.css" />
<script type="text/javascript" src="/Scripts/tagit/jquery.tagsinput.min.js"></script>

<script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/jquery-ui.min.js'></script>
<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/themes/south-street/jquery-ui.css" />